/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ex6.Banking;

/**
 *
 * @author Root
 */
public class Account {

    protected double balance;

    public Account() {
    }

    public Account(double balance) {
        this.balance = balance;
//        System.out.println("Creating  account with a " + balance + " balance");
    }

    public double getBalance() {
        return balance;

    }

    public boolean Deposit(double amt) {
        if (amt < 0) {
            return false;
        } else {
            return true;
        }

    }

//    public double deposit(double amt) {
//        if (!Deposit(amt)) {
//            System.out.println("deposit " + amt + "  " + Deposit(amt));
//            return balance;
//        } else {
//            System.out.println("deposit " + amt + "  " + Deposit(amt));
//            return balance = (balance + amt);
//        }
//
//
//
//    }
//
    public boolean withdraw(double amt) {
        if (amt > balance) {
            return false;
        } else {
            return true;
        }

    }
//
//    public double Withdraw(double amt) {
//        if (!withdraw(amt)) {
//            System.out.print("withdraw " + amt + "  ");
//            System.out.println(withdraw(amt));
//            return balance;
//        } else {
////            System.out.print("withdraw " + amt + "  ");
////            System.out.println(withdraw(amt));
//            return balance = (balance - amt);
//        }
//
//    }
//    public void show_acc() {
//        System.out.println("Creating an account with a " + balance + " balance");
//
//    }
//
//    public void show_balance() {
//        System.out.println("the  account has a balance of  " + getBalance());
//
//    }
}
